package com.frame.service.impl;

import com.frame.domain.Retail;
import com.frame.mapper.RetailMapper;
import com.frame.service.RetailService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RetailServiceImpl implements RetailService {

    @Autowired
    private RetailMapper retailMapper;


    @Override
    public PageInfo<Retail> list(Retail retail,Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Retail> list = retailMapper.list(retail);
        PageInfo<Retail> info = new PageInfo<>(list);
        return info;
    }

    @Override
    public boolean add(Retail retail) {
        return retailMapper.add(retail);
    }

    @Override
    public boolean update(Retail retail) {
        return retailMapper.update(retail);
    }

    @Override
    public boolean delete(String id) {
        return retailMapper.delete(id);
    }

    @Override
    public List<Retail> excellist() {
        return retailMapper.excelList();
    }

    @Override
    public List<Map<String, Object>> zList() {
        return retailMapper.zList();
    }

    @Override
    public void inserRetail(Retail retail) {
        retailMapper.insterRetail(retail);
    }

    @Override
    public List<Retail> getProcessList() {
        return retailMapper.getProcessList();
    }

    @Override
    public Retail getById(Integer id) {

        return retailMapper.getById(id);
    }

    @Override
    public Boolean updateById( Retail retail) {
        return retailMapper.updateById(retail);
    }

    @Override
    public List<Retail>city(String id) {
        return retailMapper.city(id);
    }


}
